#pragma GCC optimize(2)
#include <iostream>
#include <queue>
#include <map>
#include <unordered_map>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <cstring>
#include <set>
#include <unordered_set>
#include <stack>
#include <bitset>
#define F first
#define S second
#define IOS ios::sync_with_stdio(false), cin.tie(0), cout.tie(0)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
const int N=1e5+10;
ll a[N];
ll b[N];
void solve()
{
	int n,m;
	cin>>n>>m;
	for(int i=1;i<=n;i++)
	{
		cin>>a[i];
	}
	for(int i=1;i<=m;i++) cin>>b[i];
	sort(a+1,a+1+n);
	sort(b+1,b+1+m);
	int ans=0;
	b[0]=-1e18; 
	b[m+1]=2e9;
	a[n+1]=1e18;
	for(int i=0,j=1;i<=m;i++)
	{
		int cnt=0;
		while(a[j]<=b[i]) j++;
		while(a[j]>b[i] && a[j]<b[i+1] && j<=n)
		{
			cnt++;
			j++;
		}
		ans=max(ans,cnt);
	}
	if(ans) cout<<ans<<'\n';
	else cout<<"Impossible"<<endl;
}
int main()
{
	IOS;
	int T=1;
	cin>>T;

	while(T--)
	{
		solve();
	}

	return 0;
}

